package com.ht.aems.fesmonitor.actions.view;

import com.ht.aems.fesmonitor.FesMonitor;
import com.ht.aems.swing.util.MyAction;

import javax.swing.*;
import java.awt.event.ActionEvent;

/**
 * Created by IntelliJ IDEA.
 *
 * @author Dong Shufeng
 *         Date: 2008-7-19
 */
public class ShowToolBar extends MyAction {
    public void actionPerformed(ActionEvent e) {
        Object obj = e.getSource();
        boolean b = ((JCheckBoxMenuItem) obj).isSelected();
        ((FesMonitor) this.getAncestor()).getToolBar().setVisible(b);
    }


    public void update(AbstractButton button) {
        FesMonitor monitor = (FesMonitor) this.getAncestor();
        button.setSelected(monitor.getToolBar().isVisible());
    }
}
